﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net.Sockets;

namespace ggprot
{
    public class GGUserDataUser
    {
        private int uin;
        private int num;
        private GGUserDataAttrib[] attribs;

        public GGUserDataAttrib[] Attribs
        {
            get { return attribs; }
            set { attribs = value; }
        }

        public int Num
        {
            get { return num; }
            set { num = value; }
        }

        public int Uin
        {
            get { return uin; }
            set { uin = value; }
        }

        public void Read(NetworkStream stream)
        {
            BinaryReader reader = new BinaryReader(stream);
            uin = reader.ReadInt32();
            num = reader.ReadInt32();

            attribs = new GGUserDataAttrib[num];

            for (int j = 0; j < num; j++)
            {
                GGUserDataAttrib attrib = new GGUserDataAttrib();
                attrib.Read(stream);

                attribs[j] = attrib;
            }
        }
    }
}
